<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>商品详情</title>
</head>
<body>
<div id="ato">
<div class="row" id="result">
    商品名称 商品价格 商品库存
</div>
</div>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script>
    let ato=document.querySelector('#ato');
    function getProductList() {
        $.ajax({
            method: 'get',
            url:'load',
            success:function (body) {
                console.log(body);
                for(let i=0;i< body.length;i++){
                    let newDiv2=document.createElement('div');
                    newDiv2.className='row';
                    let massage = body[i];
                    console.log(massage)
                    newDiv2.innerHTML=massage.name+"   "+massage.price+"   "+massage.sum;
                    ato.appendChild(newDiv2);
                    console.log("数据获取成功")
                }
            }
        });
    }
    getProductList();
</script>
</body>
</html>